﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PPIDesktopClient.General;

namespace PPIDesktopClient.Presenter
{
    public interface IUploadStats
    {
        int ProgressBarValue { set; }
        int ProgressBarValueImages { set; }
        event EventHandler<EventArgs> StartUpload;
        event EventHandler<EventArgs> StopUpload;
        event EventHandler<EventArgs> OnLoad;
    }


    public class UploadStatsPresenter
    {
        private IUploadStats m_View;

        protected UploadProcess m_ProcessUploadData;
        protected UploadProcessImages m_ProcessUploadImages;


        public UploadStatsPresenter(IUploadStats view)
        {
            m_View = view;
            m_ProcessUploadData = new UploadProcess();
            m_ProcessUploadImages = new UploadProcessImages();
            Initialize();
        }
        
        private void Initialize()
        {
            m_View.OnLoad += new EventHandler<EventArgs>(m_View_OnLoad);
            m_View.StartUpload += new EventHandler<EventArgs>(m_View_StartUpload);
            m_View.StopUpload += new EventHandler<EventArgs>(m_View_StopUpload);

            m_ProcessUploadData.UploadCancelled += new EventHandler(m_ProcessUploadData_UploadCancelled);
            m_ProcessUploadData.UploadCancelledByInformation += new EventHandler<PPIDesktopClient.Events.MessageArgs>(m_ProcessUploadData_UploadCancelledByInformation);
            m_ProcessUploadData.UploadedDatabase += new EventHandler<PPIDesktopClient.Events.CompletedDatabaseArgs>(m_ProcessUploadData_UploadedDatabase);
            m_ProcessUploadData.UploaderCompleted += new EventHandler(m_ProcessUploadData_UploaderCompleted);
            m_ProcessUploadData.UploaderProgressChanged += new EventHandler<System.ComponentModel.ProgressChangedEventArgs>(m_ProcessUploadData_UploaderProgressChanged);
            m_ProcessUploadData.UploadingNewDatabase += new EventHandler(m_ProcessUploadData_UploadingNewDatabase);


            m_ProcessUploadImages.UploadingNewDatabase += new EventHandler(m_ProcessUploadImages_UploadingNewDatabase);
            m_ProcessUploadImages.UploaderProgressChanged += new EventHandler<System.ComponentModel.ProgressChangedEventArgs>(m_ProcessUploadImages_UploaderProgressChanged);
            m_ProcessUploadImages.UploaderCompleted += new EventHandler(m_ProcessUploadImages_UploaderCompleted);
            m_ProcessUploadImages.UploadedDatabase += new EventHandler<PPIDesktopClient.Events.CompletedDatabaseArgs>(m_ProcessUploadImages_UploadedDatabase);
            m_ProcessUploadImages.UploadCancelled += new EventHandler(m_ProcessUploadImages_UploadCancelled);
            m_ProcessUploadImages.UploadCancelledByInformation += new EventHandler<PPIDesktopClient.Events.MessageArgs>(m_ProcessUploadImages_UploadCancelledByInformation);
        }

        private void Load()
        {
            m_View.ProgressBarValue = 0;
            m_View.ProgressBarValueImages = 0;
        }

        #region Events

        void m_View_StopUpload(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        void m_View_StartUpload(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        void m_View_OnLoad(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        void m_ProcessUploadData_UploadingNewDatabase(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        void m_ProcessUploadData_UploaderProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
        {
            throw new NotImplementedException();
        }

        void m_ProcessUploadData_UploaderCompleted(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        void m_ProcessUploadData_UploadedDatabase(object sender, PPIDesktopClient.Events.CompletedDatabaseArgs e)
        {
            throw new NotImplementedException();
        }

        void m_ProcessUploadData_UploadCancelledByInformation(object sender, PPIDesktopClient.Events.MessageArgs e)
        {
            throw new NotImplementedException();
        }

        void m_ProcessUploadData_UploadCancelled(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        void m_ProcessUploadImages_UploadingNewDatabase(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        void m_ProcessUploadImages_UploaderProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e)
        {
            throw new NotImplementedException();
        }

        void m_ProcessUploadImages_UploaderCompleted(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        void m_ProcessUploadImages_UploadedDatabase(object sender, PPIDesktopClient.Events.CompletedDatabaseArgs e)
        {
            throw new NotImplementedException();
        }

        void m_ProcessUploadImages_UploadCancelledByInformation(object sender, PPIDesktopClient.Events.MessageArgs e)
        {
            throw new NotImplementedException();
        }

        void m_ProcessUploadImages_UploadCancelled(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
